

package com.hazelcast.jet.pipeline.test;

import java.io.Serializable;

/**
 * A function which takes a timestamp and a sequence number as the input.
 *
 * @param <R> the type of the result of the function
 * @since Jet 3.2
 */
@FunctionalInterface
public interface GeneratorFunction<R> extends Serializable {

    /**
     * Applies the function to the given timestamp and sequence.
     *
     * @param timestamp the current timestamp
     * @param sequence  the current sequence
     * @return the function result
     */
    R generate(long timestamp, long sequence) throws Exception;
}
